import request from '../utils/request'
import type { ApiRes, channelsApi, articlesApi } from '../types/channels'

// channelsApi :代表返回值类型
// channelsReq :代表返回值类型
export const channels = () => {
  return request<any, ApiRes<channelsApi>>({
    url: '/channels'
  })
}

export const articles = (id: number) => {
  return request<any, ApiRes<articlesApi>>({
    url: `/articles?channel_id=${id}&timestamp=${Date.now()}`
  })
}
